<template>
    <div class="company-detail">
        <div class="info-item">
            <span class="tis">企业名称：</span>
            <div class="conts">{{detail.corpName}}</div>
        </div>
        <div class="info-item">
            <span class="tis">企业统一码：</span>
            <div class="conts">
                <Input type="text" :disabled="!isEditer" placeholder="请输入企业统一码" v-model="detail.creditCode"></Input>
            </div>
        </div>
        <div class="info-item">
            <span class="tis">企业营业执照：</span>
            <div class="conts">
                <img :src="`${$baiseImg}${detail.license}`" alt="" style="width: 200px;">
            </div>
        </div>
        <div class="info-item" v-show="false">
            <span class="tis">身份证：</span>
            <div class="conts">
                <Input type="text" :disabled="!isEditer" placeholder="请输入身份证号"></Input>
            </div>
        </div>
        <div class="info-item">
            <span class="tis">身份证正反面：</span>
            <div class="conts">
                <img :src="`${$baiseImg}${detail.cardFront}`" alt="" style="width: 200px;">
                <img :src="`${$baiseImg}${detail.cardBack}`" alt="" style="width: 200px;">
            </div>
        </div>
        <div class="control">
            <template v-if="!isEditer">
                <!-- <Button type="primary" @click="isEditer = true">编辑</Button> -->
                <Button type="primary" @click="$router.go(-1)">返回</Button>
            </template>
            <template
            v-else
            >
            <Button type="default" @click="isEditer = false">取消</Button>
            <Button type="primary">保存</Button>
            </template>
        </div>
    </div>
</template>
<script>
import {getCompanyDetail} from '@/js/api'
import {getDb} from '@/js/common'
export default {
    name: 'companyDetail',
    data () {
        return {
            isEditer: false,
            detail: {}
        }
    },
    created () {
        this.getDetail()
    },
    methods: {
        getDetail () {
            let param = {}
            let token = getDb('token')
            let userName = getDb('userName')
            param = {
                token,
                userName,
                applyID: this.$route.query.applyID || ''
            }
            getCompanyDetail(param).then(r => {
                if (r.code == '200') {
                    this.detail = r.data || {}
                }
            })
        }
    }
}
</script>
<style lang="less" scoped>
.company-detail {
    overflow: hidden;
    padding: 20px;
    background: #fff;
    .info-item {
        display: flex;
        font-size: 14px;
        margin-bottom: 10px;
        .tis {
            display: inline-block;
            width: 100px;
            text-align: right;
            color: #333;
        }
        .conts {
            padding-left: 10px;
        }
    }
    .control {
        text-align: center;
        button {
            margin-left: 20px;
        }
    }
}
</style>